Skip to content

Conversation

@stevenzeck
Copy link
Contributor

@stevenzeck stevenzeck commented May 21, 2022

This is an initial start of rewriting the TestApp using SwiftUI. Not much works at the moment, but I wanted to start putting things together so others can contribute.

What's been done

  1. Added a tab bar with tabs for Bookshelf, Catalogs, and About. Used icons from Apple for them.
  2. Content for the About screen. The layout isn't optimized precisely yet though
  3. Catalogs tab has the 3 default OPDS feeds (can't delete these yet)
  4. Bookshelf retrieves the list of books from the database and displays the cover image, title, and authors. Nothing else at the moment. The layout for this also isn't optimized yet. You can test this by using a branch other than swiftui and downloading a book, then switch to the swiftui branch
  5. Add a new function, parseURL, to async parse OPDS feeds. The function name is the same as the current one, just async, so no breaking changes
  6. Adopted the use of "ViewModel" for each screen. Whether this is a good architectural change or not remains to be seen.
  7. Sheet view for adding a book from the Bookshelf tab (non-functional right now, only UI)
  8. Sheet view for adding an OPDS feed from the Catalogs tab. Validates that the title and URL are there before allowing saving, then validates the URL before adding. If it fails, it shows an alert.

What you need to do

  1. After you checkout this branch, rerun make dev
  2. To run the TestApp with SwiftUI, comment out @UIApplicationMain in AppDelegate.swift and uncomment @main in TestApp.swift

@stevenzeck stevenzeck marked this pull request as draft June 3, 2022 04:51
@stevenzeck stevenzeck marked this pull request as ready for review June 11, 2022 16:57
}
}

func deleteCatalogs(ids: [Catalog.Id]) async throws {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mickael-menu can we keep this or refactor to however you want it? It will be used at some point

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Erm sorry, I missed your comment before merging the PR. This should be easy to reintroduce when we'll use it.

Copy link
Member

@mickael-menu mickael-menu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for kickstarting the SwiftUI rewrite!

@mickael-menu mickael-menu merged commit ac877ad into readium:swiftui Jun 11, 2022
stevenzeck added a commit to stevenzeck/swift-toolkit that referenced this pull request Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants